<template>
  <div>
    <div class="StepOne-form">
      <Steps :current="0">
        <Step title="基础信息" content="这里是该步骤的描述信息"></Step>
        <Step title="线路配置" content="这里是该步骤的描述信息"></Step>
        <Step title="人员配置" content="这里是该步骤的描述信息"></Step>
      </Steps>
      <Form :model="formItem" :label-width="100">
        <FormItem class="form-input" label="巡检主题">
          <Input v-model="formItem.title" type="textarea" placeholder="请输入巡检主题"></Input>
        </FormItem>
        <FormItem class="form-input" label="巡检备注">
          <Input v-model="formItem.desc" type="textarea" placeholder="请输入巡检备注"></Input>
        </FormItem>
        <FormItem class="form-input" label="最少巡检人数" >
          <InputNumber :max="10" :min="1" v-model="formItem.peoNum"></InputNumber>
        </FormItem>
        <FormItem label="巡检附件">
          <Upload :action="formItem.fileUrl">
            <Button icon="ios-cloud-upload-outline">选择文件上传</Button>
          </Upload>
        </FormItem>
      </Form>
      <div class="from-btn">
        <Button type="primary" @click="next()">下一步</Button>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  props: ['current'],
  data () {
    return {
      formItems: {
        input: '',
        select: '',
        radio: 'male',
        valua: 1
      }
    }
  },
  computed: {
    ...mapState({
      formItem: state => state.step.step
    })
  },
  mounted () {
    // console.log(mapState(['num', 'num2']))
    console.log(this.$store)
  },
  methods: {
    ...mapMutations('step', ['addNum']),
    // 下一步
    next () {
      this.addNum(this.formItem)
      this.$router.push({ path: '/StepTwo', query: { equId: this.formItem.title } })
    }
  }
}
</script>

<style lang="less">
@import "../assets/style/StepOne/StepOne";
</style>
